package com.micro.glszh.stat.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.micro.glszh.stat.base.BaseEntity;
import com.micro.glszh.stat.base.ValidationGroups;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * biz_matter_detail
 *
 * @Author gaopengfei
 * @create 2024/10/21 15:53
 */
@TableName("biz_matter_detail")
@Data
@ApiModel(description="biz_matter_detail")
public class BizMatterDetail extends BaseEntity implements Serializable {
    /**
    * 主键id
    */
    @TableId
    @ApiModelProperty(value="主键id")
    @NotNull(groups = ValidationGroups.Update.class, message = "主键id不能为null")
    private Long id;


    public void setId(Long id) {
        if (id > 1736320698000L) {
            this.id = null;
        } else {
            this.id = id;
        }
    }

    @ApiModelProperty(value="记录主键id")
    @TableField(value = "record_id")
    @NotNull(groups = {ValidationGroups.Update.class, ValidationGroups.Insert.class }, message = "主键id不能为null")
    private Long recordId;

    /**
    * 学生姓名
    */
    @ApiModelProperty(value="学生姓名")
    @Size(max = 20,message = "学生姓名最大长度要小于 20")
    @NotBlank(message = "学生姓名不能为空")
    private String name;

    /**
    * 请假事由
    */
    @ApiModelProperty(value="请假事由")
    @Size(max = 50,message = "请假事由最大长度要小于 50")
    @NotBlank(message = "请假事由不能为空")
    private String reason;

    /**
    * 请假日期
    */
    @ApiModelProperty(value="请假日期")
    @NotNull(message = "请假日期不能为null")
    private LocalDateTime leaveDate;

    /**
    * 请假时长
    */
    @ApiModelProperty(value="请假时长")
    @Size(max = 20,message = "请假时长最大长度要小于 20")
    private String leaveDuration;

    /**
    * 班级序号
    */
    @ApiModelProperty(value="班级序号")
    @NotNull(message = "班级序号不能为null")
    private Integer classId;

    /**
    * 年级
    */
    @ApiModelProperty(value="年级")
    @NotNull(message = "年级不能为null")
    private Integer grade;

    /**
    * 性别 0 男，1 女
    */
    @ApiModelProperty(value="性别 0 男，1 女")
    private Integer gender;

    /**
    * 返校时间
    */
    @ApiModelProperty(value="返校时间")
    @NotNull(message = "返校时间不能为null")
    private LocalDateTime backDate;


    /**
     * 事假病假，区分
     */
    @ApiModelProperty(value="0 病假")
    private Integer type;

    private static final long serialVersionUID = 1L;

}